#include <stdio.h>
#include <signal.h>

int main (void)
{
	sigset_t  set;
	int m;
	//将信号集set初始化为空
	sigemptyset (&set);
	//将2号信号增加到集合中
	sigaddset (&set, 2);
	m = sigismember (&set, 2);
	if (-1 == m) {
		perror ("sigismember ()");
	} 
	if (1 == m) {
		printf ("yes...\n");
	} else if (0 == m) {
		printf ("no....\n");
	}

	//将2信号从集合中删除
	sigdelset (&set, 2);
	m = sigismember (&set, 2);
	if (-1 == m) {
		perror ("sigismember ()");
	} 
	if (1 == m) {
		printf ("yes...\n");
	} else if (0 == m) {
		printf ("no....\n");
	}
	return 0;
}

